package com.cjx.demo1.controller;

import com.cjx.common.api.CommonResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
*@Description demo1 Controller
*@Verson v1.0.0
*@Author cjunxian
*@Date
*/
@Api(tags = "Demo1服务接口", value = "Demo1Controller")
@RefreshScope//使用配置中心
@RestController
@RequestMapping("/demo1")
public class Demo1Controller {

    @Value("${config.test}")
    public String configTest;

    @ApiOperation(value = "测试动态配置")
    @GetMapping("/getConfig")
    public CommonResult getConfig(){
        return CommonResult.success(configTest);
    }
}
